package cn.tedu.store.service.impl;


import cn.tedu.store.entity.LisTestReg;
import cn.tedu.store.mapper.FuYouRegMapper;
import cn.tedu.store.mapper.JiKongRegMapper;
import cn.tedu.store.mapper.PeoPleRegMapper;
import cn.tedu.store.mapper.ZhongYiRegMapper;
import cn.tedu.store.service.ListTestRegService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ListTestRegServiceImpl implements ListTestRegService {

    @Autowired
    private ZhongYiRegMapper listTestRegMapper;
    @Autowired
    private PeoPleRegMapper peoPleRegMapper;
    @Autowired
    JiKongRegMapper jiKongRegMapper;
    @Autowired
    FuYouRegMapper fuYouRegMapper;

    @Override
    public Map<String, LisTestReg> getOneReg(String idEnNo, String barCode) {

        HashMap<String,LisTestReg> map = new HashMap<>();

        if ( listTestRegMapper.selectExist(idEnNo, barCode) >= 1){
            LisTestReg listTestReg = listTestRegMapper.selcetOneReg(idEnNo, barCode);
            map.put("枝江市中医医院",listTestReg);
            return  map;
        }else if (peoPleRegMapper.selectExist(idEnNo, barCode) >= 1){
            LisTestReg listTestReg = peoPleRegMapper.selcetPeoPleOneReg(idEnNo, barCode);
            map.put("枝江市人民医院",listTestReg);
            return map;
        }else if (jiKongRegMapper.selectExist(idEnNo, barCode) >= 1){

            LisTestReg listTestReg = jiKongRegMapper.selcetJiKongOneReg(idEnNo, barCode);
            map.put("枝江疾控中心",listTestReg);
            return map;
        }else if (fuYouRegMapper.selectExist(idEnNo, barCode)>=1) {
            LisTestReg listTestReg4 = fuYouRegMapper.selcetFuYouOneReg(idEnNo, barCode);
            map.put("枝江妇幼保健院",listTestReg4);
            return map;
        }



    return null;

    }
}
